#include    "hysteresis.h"

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
Hysteresis::Hysteresis()
    : x_min(0.0)
    , x_max(0.0)
    , state(false)
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
Hysteresis::~Hysteresis()
{

}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
void Hysteresis::setRange(double x_min, double x_max)
{
    this->x_min = x_min;
    this->x_max = x_max;
}

//------------------------------------------------------------------------------
//
//------------------------------------------------------------------------------
bool Hysteresis::getState(double x)
{
    if (x <= x_min)
        state = true;

    if (x >= x_max)
        state = false;

    return state;
}


